#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
int n,l,a[maxn],b[maxn],ans;
int read(){
    int s=0;
    char ch=getchar(),last=' ';
    while(ch<'0'||ch>'9')
        last=ch,ch=getchar();
    while(ch>='0'&&ch<='9')
        s=(s<<1)+(s<<3)+(ch^48),ch=getchar();
    return last=='-'?-s:s;
}
void solve(int x,int u,int v){
    if(x>n){
        if(u<=l)
            ans=max(ans,v);
        return;
    }
    solve(x+1,u,v);
    solve(x+1,u^a[x],v^b[x]);
}
signed main(){
    freopen("lock.in","r",stdin);
    freopen("lock.out","w",stdout);
    n=read(),l=read();
    for(int i=1;i<=n;i++)
        a[i]=read(),b[i]=read();
    solve(1,0,0);
    printf("%lld\n",ans);
    return 0;
}